![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
The population manager class for beetles. More...
#include <bembidion_all.h>
Public Member Functions | |
void | CreateObjects (int ob_type, TAnimal *pvo, void *null, struct_Bembidion *data, int number) |
Method to add beetles to the population. More... | |
virtual void | Init (void) |
Intialises the population manager. More... | |
virtual void | DoFirst (void) |
Does day degree development calculations here. More... | |
virtual void | DoBefore (void) |
Replaces the Step function for the Egg_List. More... | |
virtual void | DoAlmostLast (void) |
Removes dead or pupated larvae from the simulation. More... | |
virtual void | DoLast (void) |
Adds output adult locations to DoLast. More... | |
virtual float | Probe (int ListIndex, probe_data *p_TheProbe) |
Overides the Population_Manager::Probe method. More... | |
Bembidion_Population_Manager (Landscape *p_L) | |
Constructor. More... | |
virtual | ~Bembidion_Population_Manager () |
Destructor. More... | |
int | SupplyAdPopSize () |
Get adult population size. More... | |
int | SupplyEggPopSize () |
Get egg population size. More... | |
int | SupplyLarvaePopSize () |
Get larval population size. More... | |
int | SupplyPupaePopSize () |
Get pupal population size. More... | |
double | SupplyEDayDeg (int day) |
Get egg day degress for a specific day. More... | |
double | SupplyLDayDeg (int L, int day) |
Get larval day degress for a specific dayand instar. More... | |
double | SupplyPDayDeg (int day) |
Get pupal day degress for a specific day. More... | |
![]() | |
Population_Manager (Landscape *L) | |
virtual | ~Population_Manager (void) |
void | SetNoProbes (int a_pn) |
unsigned | GetLiveArraySize (int a_listindex) |
Gets the number of 'live' objects for a list index in the TheArray. More... | |
void | IncLiveArraySize (int a_listindex) |
Increments the number of 'live' objects for a list index in the TheArray. More... | |
virtual void | Catastrophe (int) |
unsigned int | FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal) |
char * | SpeciesSpecificReporting (int a_species, int a_time) |
char * | ProbeReport (int a_time) |
char * | ProbeReportTimed (int a_time) |
void | ImpactProbeReport (int a_Time) |
bool | BeginningOfMonth () |
void | LOG (const char *fname) |
int | SupplyStepSize () |
int | SupplySimW () |
int | SupplySimH () |
virtual void | Run (int NoTSteps) |
virtual void | ImpactedProbe () |
int | SupplyListNameLength () |
TAnimal * | SupplyAnimalPtr (int a_index, int a_animal) |
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More... | |
unsigned | SupplyListIndexSize () |
unsigned | SupplyListSize (unsigned listindex) |
bool | CheckXY (int l, int i) |
Debug method to test for out of bounds coordinates. More... | |
const char * | SupplyListName (int i) |
bool | IsLast (unsigned listindex) |
int | SupplyState (unsigned listindex, unsigned j) |
virtual void | SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y) |
const char * | SupplyStateNames (int i) |
unsigned | SupplyStateNamesLength () |
virtual void | DisplayLocations () |
int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
TAnimal * | FindClosest (int x, int y, unsigned Type) |
bool | OpenTheRipleysOutputProbe (string a_NWordFilename) |
void | OpenTheAOROutputProbe (string a_AORFilename) |
bool | OpenTheMonthlyRipleysOutputProbe () |
bool | OpenTheReallyBigProbe () |
void | CloseTheMonthlyRipleysOutputProbe () |
virtual void | CloseTheRipleysOutputProbe () |
virtual void | CloseTheReallyBigOutputProbe () |
TTypesOfPopulation | GetPopulationType () |
int | GetSeasonNumber () |
Get the season number. More... | |
void | LamdaDeath (int x, int y) |
void | LamdaBirth (int x, int y) |
void | LamdaBirth (int x, int y, int z) |
void | LamdaClear () |
void | LamdaDumpOutput () |
virtual int | SupplyPegPosx (int) |
virtual int | SupplyPegPosy (int) |
virtual int | SupplyCovPosx (int) |
virtual int | SupplyCovPosy (int) |
virtual bool | OpenTheFledgelingProbe () |
virtual bool | OpenTheBreedingPairsProbe () |
virtual bool | OpenTheBreedingSuccessProbe () |
virtual void | BreedingPairsOutput (int) |
virtual int | TheBreedingFemalesProbe (int) |
virtual int | TheFledgelingProbe () |
virtual void | BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int) |
virtual int | TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &) |
virtual void | FledgelingProbeOutput (int, int) |
virtual void | TheGeneticProbe (unsigned, int, unsigned &) |
virtual void | GeneticsResultsOutput (FILE *, unsigned) |
Public Attributes | |
MovementMap * | m_MoveMap |
Map of suitability for movement. More... | |
SimplePositionMap * | m_LarvaePosMap |
Optimised map of larval positions. More... | |
SimplePositionMap * | m_AdultPosMap |
Optimsied map of adult positions. More... | |
int | LDDepMort0 |
Storage for density-dependent mortality parameter. More... | |
double | LDDepMort1 |
Storage for density-dependent mortality parameter. More... | |
int | ADDepMort0 |
Storage for density-dependent mortality parameter. More... | |
double | ADDepMort1 |
Storage for density-dependent mortality parameter. More... | |
int | TodaysEggProduction |
Daily temperature determined egg production. More... | |
Bembidion_Egg_List * | m_EList [365] |
Replacement for TheArray[0]. More... | |
![]() | |
int | IndexArrayX [5][10000] |
probe_data * | TheProbe [100] |
int | SimH |
int | SimW |
unsigned | SimHH |
unsigned | SimWH |
char | m_SimulationName [255] |
bool | ProbesSet |
Landscape * | m_TheLandscape |
Protected Member Functions | |
virtual void | Catastrophe () |
Method to arbitrarily alter populations size. More... | |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
Special output functionality. More... | |
virtual void | TheReallyBigOutputProbe () |
Special output functionality. More... | |
virtual void | TheAOROutputProbe () |
Special output functionality. More... | |
bool | IsStartHabitat (int a_x, int a_y) |
Used to specify legal starting habitats for simulation start-up. More... | |
![]() | |
virtual bool | StepFinished () |
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More... | |
virtual void | DoAfter () |
void | EmptyTheArray () |
Removes all objects from the TheArray by deleting them and clearing TheArray. More... | |
void | SortX (unsigned Type) |
void | SortXIndex (unsigned Type) |
void | SortY (unsigned Type) |
void | SortState (unsigned Type) |
void | SortStateR (unsigned Type) |
unsigned | PartitionLiveDead (unsigned Type) |
void | Shuffle_or_Sort (unsigned Type) |
void | Shuffle (unsigned Type) |
Protected Attributes | |
Landscape * | The_Landscape |
Pointer to the landscape. More... | |
int | m_AdPopSize |
To store the current population size. More... | |
int | m_EPopSize |
To store the current population size. More... | |
int | m_LPopSize |
To store the current population size. More... | |
int | m_PPopSize |
To store the current population size. More... | |
double | m_EDayDeg [365] |
Storage for daily day degrees for eggs. More... | |
double | m_LDayDeg [365][3] |
Storage for daily day degrees for larve. More... | |
double | m_PDayDeg [365] |
Storage for daily day degrees for pupae. More... | |
![]() | |
vector< unsigned > | m_LiveArraySize |
int | m_NoProbes |
AOR_Probe * | m_AOR_Probe |
FILE * | m_GeneticsFile |
FILE * | m_AlleleFreqsFile |
FILE * | m_EasyPopRes |
const char * | StateNames [100] |
int | m_catastrophestartyear |
int | m_StepSize |
vector< TListOfAnimals > | TheArray |
unsigned | StateNamesLength |
const char * | m_ListNames [32] |
unsigned | m_ListNameLength |
FILE * | TestFile |
FILE * | TestFile2 |
unsigned | BeforeStepActions [12] |
int | m_SeasonNumber |
Holds the season number. Used when running goose and hunter sims. More... | |
TTypesOfPopulation | m_population_type |
ofstream * | AOROutputPrb |
FILE * | RipleysOutputPrb |
FILE * | RipleysOutputPrb1 |
FILE * | RipleysOutputPrb2 |
FILE * | RipleysOutputPrb3 |
FILE * | RipleysOutputPrb4 |
FILE * | RipleysOutputPrb5 |
FILE * | RipleysOutputPrb6 |
FILE * | RipleysOutputPrb7 |
FILE * | RipleysOutputPrb8 |
FILE * | RipleysOutputPrb9 |
FILE * | RipleysOutputPrb10 |
FILE * | RipleysOutputPrb11 |
FILE * | RipleysOutputPrb12 |
FILE * | ReallyBigOutputPrb |
long int | lamdagrid [2][257][257] |
The population manager class for beetles.
Bembidion_Population_Manager::Bembidion_Population_Manager | ( | Landscape * | p_L | ) |
Constructor.
References ADDepMort0, ADDepMort1, cfg_ADDepMort0, cfg_ADDepMort1, cfg_LDDepMort0, cfg_LDDepMort1, cfg_MaxDailyMovement, Init(), LDDepMort0, LDDepMort1, m_AdultPosMap, m_EDayDeg, m_EList, m_LarvaePosMap, m_LDayDeg, m_MoveMap, m_PDayDeg, MaxDailyMovement, Population_Manager::TheArray, TodaysEggProduction, and CfgInt::value().
|
virtual |
|
protectedvirtual |
Method to arbitrarily alter populations size.
This method simply alters populations on 1st January - either by increasing or decreasing them. Increases are by 'cloning', decrease by pro-rata mortality. The effect is under the control of configuration variables cfg_pm_eventfrequency and cfg_pm_eventsize.
Reimplemented from Population_Manager.
References bob_Adult, cfg_pm_eventfrequency, cfg_pm_eventsize, Bembidion_Base::CopyMyself(), Bembidion_Base::CurrentBState, Population_Manager::GetLiveArraySize(), Population_Manager::m_catastrophestartyear, Population_Manager::m_TheLandscape, random(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, tobs_ADying, and CfgInt::value().
void Bembidion_Population_Manager::CreateObjects | ( | int | ob_type, |
TAnimal * | pvo, | ||
void * | null, | ||
struct_Bembidion * | data, | ||
int | number | ||
) |
Method to add beetles to the population.
All bembidion objects that are created must be created using this method. Data on the location and other attributes are passed in data, and the number to create in number.
References Bembidion_Egg_List::AddEgg(), Population_Manager::GetLiveArraySize(), SimplePositionMap::GetMapValue(), Population_Manager::IncLiveArraySize(), struct_Bembidion::L, m_EList, m_LarvaePosMap, SimplePositionMap::SetMapValue(), Landscape::SupplyDayInYear(), Population_Manager::TheArray, struct_Bembidion::x, and struct_Bembidion::y.
Referenced by Bembidion_Base::CopyMyself(), Bembidion_Base::CopyMyselfB(), Init(), Bembidion_Adult::Reproduce(), Bembidion_Pupae::st_Emerge(), Bembidion_Egg_List::st_Hatch(), and Bembidion_Larvae::st_Pupate().
|
virtual |
Removes dead or pupated larvae from the simulation.
This sorts the larval list according to state, then removes the dead ones. This is a little faster than leaving the job to the default population manager functionality.
Reimplemented from Population_Manager.
|
virtual |
Replaces the Step function for the Egg_List.
Reimplemented from Population_Manager.
References m_EList.
|
virtual |
Does day degree development calculations here.
This method removes any young stages that have survived until winter.
It subsequently calculates day degree development for each day for each beetle stage. This is an optimising strategy to prevent each beetle individual calculating these.
Finally it replaces the Egg_List BeginStep functionality. This is also an optimisation since it only requires 365 Egg_lists, one for each day of the year instead of millions of individual eggs.
NB this breaks the traditional ALMaSS protocol for handling animal individuals.
Reimplemented from Population_Manager.
References above12Egg, above12Larvae, above12Pupae, AdultEggLayingThreshold, Bembidion_Egg_List::BeginStep(), bob_Adult, bob_Egg, bob_Larva, bob_Pupa, DevelConst1, DevelopmentInflectionPoint, Bembidion_Egg_List::EggList, EggProductionSlope, Population_Manager::GetLiveArraySize(), Population_Manager::LamdaClear(), Population_Manager::LamdaDumpOutput(), m_AdPopSize, m_EDayDeg, m_EList, m_EPopSize, m_LDayDeg, m_LPopSize, m_PDayDeg, m_PPopSize, Population_Manager::m_TheLandscape, March, Landscape::SupplyDayInYear(), Landscape::SupplyTemp(), Population_Manager::TheArray, and TodaysEggProduction.
|
virtual |
Adds output adult locations to DoLast.
Outputs the adult locations if needed
Reimplemented from Population_Manager.
References cfg_SaveInfieldLocation, cfg_SaveInfieldLocationInterval, cfg_SaveInfieldLocationStartDay, Population_Manager::DoLast(), Population_Manager::m_TheLandscape, Landscape::SupplyDayInMonth(), Landscape::SupplyDayInYear(), CfgInt::value(), and CfgBool::value().
|
virtual |
Intialises the population manager.
Initialises the population manager and creates the initial beetle population.
Housekeeping actions such as setting up probe files and recording life-stage and state names are done here.
An optimisation is to sort the larval list by x-coordinate to speed searching later. This removes the default randomising function for larvae.
References Population_Manager::BeforeStepActions, struct_Bembidion::BPM, cfg_beetlestartnos, cfg_BemAdultPPPEffectProb, cfg_BemAdultPPPEffectProbDecay, cfg_BemAdultPPPElimiationRate, cfg_BemAdultPPPThreshold, cfg_InCropRef, cfg_ReallyBigOutput_used, cfg_RipleysOutput_used, cfg_SaveInfieldLocation, CreateObjects(), IsStartHabitat(), struct_Bembidion::L, m_AdPopSize, m_EPopSize, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, m_LPopSize, Population_Manager::m_population_type, m_PPopSize, Population_Manager::m_SimulationName, Population_Manager::m_TheLandscape, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), random(), Population_Manager::ReallyBigOutputPrb, Bembidion_Adult::SetAdultPPPElimRate(), Bembidion_Adult::SetPPPEffectProb(), Bembidion_Adult::SetPPPEffectProbDecay(), Bembidion_Adult::SetPPPThreshold(), Population_Manager::StateNames, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), tobs_ADying, tobs_Aggregating, tobs_Dispersing, tobs_EDeveloping, tobs_EDying, tobs_Emerging, tobs_Foraging, tobs_Hatching, tobs_Hibernating, tobs_Initiation, tobs_LDeveloping, tobs_LDying, tobs_PDeveloping, tobs_PDying, tobs_Pupating, TOP_Beetle, Landscape::TranslateVegTypes(), CfgInt::value(), CfgFloat::value(), CfgBool::value(), struct_Bembidion::x, and struct_Bembidion::y.
Referenced by Bembidion_Population_Manager().
|
protected |
Used to specify legal starting habitats for simulation start-up.
References Population_Manager::m_TheLandscape, Landscape::SupplyElementType(), tole_Field, tole_FieldBoundary, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_RoadsideVerge, tole_UnsprayedFieldMargin, tole_WaterBufferZone, and tole_YoungForest.
Referenced by Init().
|
virtual |
Overides the Population_Manager::Probe method.
The parent class Probe method needs to be overridden because of the use of the Egg_List class. Otherwise functionality is the same as parent class.
Reimplemented from Population_Manager.
References Bembidion_Egg_List::EggList, Population_Manager::GetLiveArraySize(), AnimalPosition::m_EleType, m_EList, probe_data::m_NoAreas, probe_data::m_NoEleTypes, probe_data::m_NoFarms, probe_data::m_NoVegTypes, probe_data::m_Rect, probe_data::m_RefEle, probe_data::m_RefFarms, probe_data::m_RefVeg, Population_Manager::m_TheLandscape, AnimalPosition::m_VegType, AnimalPosition::m_x, rectangle::m_x1, rectangle::m_x2, AnimalPosition::m_y, rectangle::m_y1, rectangle::m_y2, Landscape::SupplyElementType(), Landscape::SupplyFarmOwner(), Landscape::SupplyVegType(), and Population_Manager::TheArray.
|
inline |
|
inline |
Get egg day degress for a specific day.
References m_EDayDeg.
Referenced by Bembidion_Egg_List::st_Develop().
|
inline |
|
inline |
|
inline |
Get larval day degress for a specific dayand instar.
References m_LDayDeg.
Referenced by Bembidion_Larvae::st_Develop().
|
inline |
Get pupal day degress for a specific day.
References m_PDayDeg.
Referenced by Bembidion_Pupae::st_Develop().
|
inline |
|
protectedvirtual |
Special output functionality.
Reimplemented from Population_Manager.
References bob_Adult, AOR_Probe::DoProbe(), and Population_Manager::m_AOR_Probe.
|
protectedvirtual |
Special output functionality.
Another spatial output method. This time with extra information over and above the x,y, coord found in the Ripley Probe.
Reimplemented from Population_Manager.
References bob_Adult, TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, Population_Manager::ReallyBigOutputPrb, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplyPolyRef(), Landscape::SupplySimAreaWidth(), and Population_Manager::TheArray.
|
protectedvirtual |
Special output functionality.
A spatial output. This dumps the x,y co-ordinates for all adults to a text file.
Reimplemented from Population_Manager.
References bob_Adult, TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySimAreaWidth(), and Population_Manager::TheArray.
int Bembidion_Population_Manager::ADDepMort0 |
Storage for density-dependent mortality parameter.
Referenced by Bembidion_Population_Manager(), and Bembidion_Adult::DDepMort().
double Bembidion_Population_Manager::ADDepMort1 |
Storage for density-dependent mortality parameter.
Referenced by Bembidion_Population_Manager(), and Bembidion_Adult::DDepMort().
int Bembidion_Population_Manager::LDDepMort0 |
Storage for density-dependent mortality parameter.
Referenced by Bembidion_Population_Manager(), and Bembidion_Larvae::st_Develop().
double Bembidion_Population_Manager::LDDepMort1 |
Storage for density-dependent mortality parameter.
Referenced by Bembidion_Population_Manager(), and Bembidion_Larvae::st_Develop().
|
protected |
To store the current population size.
Referenced by DoFirst(), Init(), and SupplyAdPopSize().
SimplePositionMap* Bembidion_Population_Manager::m_AdultPosMap |
Optimsied map of adult positions.
Referenced by Bembidion_Population_Manager(), Bembidion_Adult::DDepMort(), Bembidion_Adult::MoveTo(), Bembidion_Adult::MoveTo_quality_assess(), Bembidion_Adult::MoveToAggr(), Bembidion_Adult::Step(), and ~Bembidion_Population_Manager().
|
protected |
Storage for daily day degrees for eggs.
Referenced by Bembidion_Population_Manager(), DoFirst(), and SupplyEDayDeg().
Bembidion_Egg_List* Bembidion_Population_Manager::m_EList[365] |
Replacement for TheArray[0].
Referenced by Bembidion_Population_Manager(), CreateObjects(), DoBefore(), DoFirst(), Probe(), and ~Bembidion_Population_Manager().
|
protected |
To store the current population size.
Referenced by DoFirst(), Init(), and SupplyEggPopSize().
SimplePositionMap* Bembidion_Population_Manager::m_LarvaePosMap |
Optimised map of larval positions.
Referenced by Bembidion_Population_Manager(), CreateObjects(), Bembidion_Larvae::st_Develop(), Bembidion_Larvae::st_Pupate(), Bembidion_Larvae::Step(), and ~Bembidion_Population_Manager().
|
protected |
Storage for daily day degrees for larve.
Referenced by Bembidion_Population_Manager(), DoFirst(), and SupplyLDayDeg().
|
protected |
To store the current population size.
Referenced by DoFirst(), Init(), and SupplyLarvaePopSize().
MovementMap* Bembidion_Population_Manager::m_MoveMap |
Map of suitability for movement.
Referenced by Bembidion_Population_Manager(), Bembidion_Adult::MoveTo_quality_assess(), Bembidion_Adult::MoveToAggr(), and ~Bembidion_Population_Manager().
|
protected |
Storage for daily day degrees for pupae.
Referenced by Bembidion_Population_Manager(), DoFirst(), and SupplyPDayDeg().
|
protected |
To store the current population size.
Referenced by DoFirst(), Init(), and SupplyPupaePopSize().
|
protected |
Pointer to the landscape.
int Bembidion_Population_Manager::TodaysEggProduction |
Daily temperature determined egg production.
Referenced by Bembidion_Population_Manager(), Bembidion_Adult::CanReproduce(), and DoFirst().